home *** CD-ROM | disk | FTP | other *** search
/ Software Vault: The Diamond Collection / The Diamond Collection (Software Vault)(Digital Impact).ISO / cdr47 / lzpip103.zip / ZIPGUTS.H < prev    next >
Text File  |  1994-06-02  |  3KB  |  105 lines

  1. #ifdef __ALLOCEXT__
  2. #    define EXTERN
  3. #    define INI(x) = x
  4. #else
  5. #    define EXTERN extern
  6. #    define INI(x)
  7. #endif
  8. #ifndef __ARGS__
  9. #    include "modern.h"
  10. #endif
  11. #define OF __ARGS__
  12. #ifndef WSIZE
  13. #    include "zipdefs.h"
  14. #endif
  15. #ifndef zfree
  16. #    include "zalloc.h"
  17. #endif
  18.  
  19. #define MIN_MATCH  3
  20. #define MAX_MATCH  258
  21. /* The minimum and maximum match lengths */
  22.  
  23. #define MIN_LOOKAHEAD (MAX_MATCH+MIN_MATCH+1)
  24. /* Minimum amount of lookahead, except at the end of the input file.
  25.    See deflate.c for comments about the MIN_MATCH+1. */
  26.  
  27. #define MAX_DIST  (WSIZE-MIN_LOOKAHEAD)
  28. /* In order to simplify the code, particularly on 16 bit machines, match
  29.    distances are limited to MAX_DIST instead of WSIZE. */
  30.  
  31. EXTERN int deflate_level INI(6);
  32. extern ulg compressed_len;
  33. #ifdef LZFILE
  34. #    ifdef EOF
  35.         EXTERN FILE *zip_out_port INI(NULL);
  36. #        define putbyte(b) putc(b, zip_out_port)
  37. #    endif
  38. #else
  39.     EXTERN int (*zip_out_port)__ARGS__((int)) INI(NULL);
  40. #    define putbyte(b) (*zip_out_port)(b)
  41. #endif
  42.  
  43. #ifdef __OS2__
  44. #  ifndef OS2
  45. #    define OS2
  46. #   endif
  47. #endif
  48. /* Diagnostic functions */
  49. #ifdef DEBUG
  50. # ifdef MSDOS
  51. #  undef  stderr
  52. #  define stderr stdout
  53. # endif
  54. # ifdef OS2
  55. #  undef  stderr
  56. #  define stderr stdout
  57. # endif
  58. #  define Assert(cond,msg) {if(!(cond)) error(msg);}
  59. #  define Trace(x) fprintf x
  60. #  define Tracev(x) {if (verbose) fprintf x ;}
  61. #  define Tracevv(x) {if (verbose>1) fprintf x ;}
  62. #  define Tracec(c,x) {if (verbose && (c)) fprintf x ;}
  63. #  define Tracecv(c,x) {if (verbose>1 && (c)) fprintf x ;}
  64. #else
  65. #  define Assert(cond,msg)
  66. #  define Trace(x)
  67. #  define Tracev(x)
  68. #  define Tracevv(x)
  69. #  define Tracec(c,x)
  70. #  define Tracecv(c,x)
  71. #endif
  72.  
  73. /* Public function prototypes */
  74.  
  75. void warn  OF((char *, char *));
  76. void err   OF((int c, char *h));
  77. void error OF((char *h));
  78.  
  79. int file_read OF((char *buf, unsigned size));
  80.  
  81.         /* in deflate.c */
  82. #ifdef DYN_ALLOC
  83. int  lm_alloc OF((void));
  84. void lm_free  OF((void));
  85. #endif
  86. int lm_init OF((void));
  87. int fast_deflate OF((char*, unsigned));
  88. int lazy_deflate OF((char*, unsigned));
  89.  
  90.         /* in trees.c */
  91. #ifdef DYN_ALLOC
  92. int  ct_alloc OF((void));
  93. void ct_free  OF((void));
  94. #endif
  95. int  ct_init  OF((void));
  96. int  ct_tally OF((int dist, int lc));
  97. ulg  flush_block OF((char far *buf, ulg stored_len, int eof));
  98.  
  99.         /* in bits.c */
  100. void bi_init   OF((void));
  101. int send_bits  OF((unsigned value, int length));
  102. int bi_windup  OF((void));
  103. int bi_putsh   OF((unsigned short));
  104. int copy_block OF((char far *buf, unsigned len, int header));
  105.